const OpenApiTool = require('baikaifa-openapi-tool');
const { resolve } = require('path');

const url = 'http://sem8jxmog.hn-bkt.clouddn.com/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2.json';
const outputDir = resolve(__dirname, 'service');

const openApiTool = new OpenApiTool({ url });
openApiTool.generateService({
    template: 'axios',
    importText: `import axios from '@/common/apiService';`,
    typescript: true,
    outputDir,
});